package com.gz.service;

import com.gz.entity.Item;
import com.gz.entity.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gz.entity.Vo.OrderVo;

import java.util.List;

/**
* @author 龙龙与贝儿
* @description 针对表【t_order】的数据库操作Service
* @createDate 2025-05-22 16:34:29
*/
public interface OrderService extends IService<Order> {

    String addNewOrder(Long userId, Integer addressId);
    List<OrderVo> queryOrder(Long userId, Integer status);

    String pay(Long orderIdStr);

    /**
     - 更新订单的状态
     *
     - @param orderId 订单ID
     - @param status  订单状态
     */
    void updateOrderStatus(String orderId, Integer status);


    /**
     - 通过订单项更新库存
     *
     - @param item
     */
    void updateBookStorage(Item item);

    void cancelOrder(Long userId, String orderId);

    void deleteOrder(Long userId, String orderId);
}
